<?php

/**
 * @name Bootstrap
 * @author xiadx
 * @desc 所有在Bootstrap类中, 以_init开头的方法, 都会被Yaf调用,
 * @see http://www.php.net/manual/en/class.yaf-bootstrap-abstract.php
 * 这些方法, 都接受一个参数:Yaf_Dispatcher $dispatcher
 * 调用的次序, 和申明的次序相同
 */

class Bootstrap extends Yaf_Bootstrap_Abstract
{

    public function _initConfig()
    {
        //把配置保存起来
        $arrConfig = Yaf_Application::app()->getConfig();
        Yaf_Registry::set('config', $arrConfig);

        $arrSetting = new Yaf_Config_Ini(DOCROOT . '/conf/setting.ini', 'setting');
        Yaf_Registry::set('setting', $arrSetting);

        Yaf_Dispatcher::getInstance()->autoRender(FALSE); // 关闭自动加载模板
        /**
         * 设置默认时区
         *
         * @see  http://php.net/timezones
         */
        date_default_timezone_set('Asia/Shanghai');

        // Load the logger if one doesn't already exist
        if (!Kohana_Exception::$log instanceof Log)
        {
            Kohana_Exception::$log = Log::instance();
            Kohana_Exception::$error_view = MODPATH . '/Kohana/Error.php';
        }

        /**
         * Attach the file write to logging. Multiple writers are supported.
         */
        Kohana_Exception::$log->attach(new Log_File(APPPATH.'/logs'));

        define('TIME_FORMAT', 'Y-m-d H:i:s');//时间格式
        define('DATE_FORMAT', 'Y-m-d');//日期格式
        define('TIMENOW', $_SERVER['REQUEST_TIME']); // 当前 Unix 时间戳
        define('VIEWPATH', __DIR__ . '/views/');

        Cookie::$salt = '17ced3';
        Cookie::$domain = 'xx.com';

        if (DIRECTORY_SEPARATOR !== '\\') {
            Cache::$default = 'memcache'; //内存缓存，若服务器没安装，可注释掉此行
        }


        /*获取客户端 IP 地址*/
        if (isset ($_SERVER ['HTTP_CLIENT_IP']))
            $ipaddress = $_SERVER["HTTP_CLIENT_IP"];
        else if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
            $ipaddress = $_SERVER["HTTP_X_FORWARDED_FOR"];
        else if (isset($_SERVER["REMOTE_ADDR"]))
            $ipaddress = $_SERVER["REMOTE_ADDR"];
        else $ipaddress = '0.0.0.0';
        define('IPADDRESS', $ipaddress);

        /*定义如果当前页面的访问是否通过SSL*/
        define('REQ_PROTOCOL', (isset($_SERVER ['HTTPS']) && ($_SERVER ['HTTPS'] == 'on' || $_SERVER ['HTTPS'] == '1') ? 'https' : 'http'));

        // 定义一些有用的内容与相关的环境
        define('USER_AGENT', $_SERVER['HTTP_USER_AGENT']);
        define('REFERRER', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');

        /*当前域名*/
        if ($_SERVER ['HTTP_HOST'] or $_ENV ['HTTP_HOST']) {
            $http_host = ($_SERVER ['HTTP_HOST'] ? $_SERVER ['HTTP_HOST'] : $_ENV ['HTTP_HOST']);
        } else if ($_SERVER ['SERVER_NAME'] or $_ENV ['SERVER_NAME']) {
            $http_host = ($_SERVER ['SERVER_NAME'] ? $_SERVER ['SERVER_NAME'] : $_ENV ['SERVER_NAME']);
        }
        define('HTTP_HOST', trim($http_host));
    }

    public function _initPlugin(Yaf_Dispatcher $dispatcher)
    {
        //注册一个插件
        $objSamplePlugin = new SamplePlugin();
        $dispatcher->registerPlugin($objSamplePlugin);
    }

    public function _initRoute(Yaf_Dispatcher $dispatcher)
    {
        //在这里注册自己的路由协议,默认使用简单路由
        $router = $dispatcher->getRouter();
        $url = $_SERVER['REQUEST_URI'];
        $url_arr = explode("/",$url);
        $version = $url_arr[1];
        /*Yaf_Dispatcher::getInstance()->getRouter()->addRoute("name",
            new Yaf_Route_rewrite(
               "index.php/Common/product", //match request uri leading "/product"
               array(
                   'controller' => "product1",  //route to product controller,
               )
            )
        );*/
        /*路由配置*/
        $config = array(
            /*获取医嘱*/
            "allYizhu" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getYizhuAllInfoJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetYizhuAllInfoJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*医嘱上传*/
            "yizhuUpload" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/yizhuHistoryDataUpload",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "YizhuHistoryDataUpload",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*医嘱上传*/
            "AsyncWithServerLogin" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/asyncWithServerLogin",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "AsyncWithServerLogin",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*上传已读新医嘱组号*/
            "Settixingyizhu" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/Settixingyizhu",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "Settixingyizhu",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*登录接口*/
            "CheckLogin" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/checkLogin",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "CheckLogin",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),

            /*登录接口*/
            "Checkshenfenzheng" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/checkshenfenzheng",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "CheckLogin",  /*匹配到的控制器*/
                    'action'     => "checkshenfenzheng",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*修改密码接口*/
            "ChangePassword" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/changePassword",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "ChangePassword",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*退出登录*/
            "Logout" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/Logout",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "Logout",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*处理测试站的每日未完成次数*/
            "UndoDailyWork" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/UndoDailyWork",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "UndoDailyWork",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取检查列表的Json*/
            "getJianchaListJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getJianchaListJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetJianchaListJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取检查列表的Json*/
            "getOneBingchengJiluData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getOneBingchengJiluData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetOneBingchengJiluData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*发热病人列表*/
            "GetFareList" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/GetFareList",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetFareList",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*app更新*/
            "LogDataUpload" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/LogDataUpload",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "LogDataUpload",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*检查列表页面Josn*/
            "JianyanJianchaList" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/JianyanJianchaList",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "JianyanJianchaList",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取病例*/
            "GetBingliList" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/GetBingliList",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetBingliList",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                    )
            ),
            /*获取历史医嘱*/
            "GetYizhuHistoryDataJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getYizhuHistoryDataJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetYizhuHistoryDataJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*接收上传过来的标本数据*/
            "biaobenDataUpload" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/biaobenDataUpload",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "BiaobenDataUpload",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*接收上传过来的体征数据*/
            "tizhengDataUpload" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/tizhengDataUpload",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "TizhengDataUpload",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*未完成医嘱数据拉取*/
            "GetUnworkYizhuDataJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getUnworkYizhuDataJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetUnworkYizhuDataJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取入院记录*/
            "GetRuYuanJiluData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/GetRuYuanJiluData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetRuYuanJiluData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取首次病程记录*/
            "GetBingchengJiluShouciData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/GetBingchengJiluShouciData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetBingchengJiluShouciData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取首次病程记录*/
            "GetFaReBingrenTingzheng" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/GetFaReBingrenTingzheng",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetFaReBingrenTingzheng",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取体征数据*/
            "getTizhengListJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getTizhengListJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetTizhengListJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取巡查项目列表，压缩成接送格式数据*/
            "getXunChaItemListJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getXunChaItemListJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetXunChaItemListJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                )
            ),
            /*获取需要提醒的医嘱*/
            "GetYizhuTixingData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getYizhuTixingData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetYizhuTixingData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取需要提醒的医嘱*/
            "TixingDataUpload" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/tixingDataUpload",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "TixingDataUpload",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*检查报告结果*/
            "getJianchaResult" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getJianchaResult",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "getJianchaResult",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*该函数只返回检验报告的查询结果*/
            "getJianyanResult" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getJianyanResult",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "getJianyanResult",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*接收上传过来的巡查记录数据*/
            "xunchaDataUpload" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/xunchaDataUpload",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "XunchaDataUpload",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*新医嘱提醒接口*/
            "newyizhu" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/newyizhu",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "newyizhu",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取巡查记录数据，压缩成json格式数据*/
            "getXunchaListJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getXunchaListJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetXunchaListJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),

            /*接收上传过来的护理统计数据*/
            "hulitongjiDataUpload" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/hulitongjiDataUpload",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HulitongjiDataUpload",  /*匹配到的控制器*/
                ),
            ),
            /*护理评估保存*/
            "hulipingguSave" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/HuliPingguDan/hulipingguSave",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliPinggu",  /*匹配到的控制器*/
                    'action'     => "hulipingguSave",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*措施执行History数据*/
            "cuoshiZhixingDataUpload" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/HuliPingguDan/cuoshiZhixingDataUpload",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliPinggu",  /*匹配到的控制器*/
                    'action'     => "cuoshiZhixingDataUpload",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取护理周期内的护理评估记录*/
            "getHulipingguDataJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/HuliPingguDan/getHulipingguDataJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliPinggu",  /*匹配到的控制器*/
                    'action'     => "getHulipingguDataJson",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取护理评估选项详细*/
            "getHulipingguxiangmu" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/HuliPingguDan/getHulipingguxiangmu",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliPinggu",  /*匹配到的控制器*/
                    'action'     => "getHulipingguxiangmu",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取护理评估措施详细*/
            "getHulipingguCuoshi" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/HuliPingguDan/getHulipingguCuoshi",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliPinggu",  /*匹配到的控制器*/
                    'action'     => "getHulipingguCuoshi",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*终端侧边栏获取护理评估、护理措施提示数据*/
            "getHulipingguRemindNum" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/HuliPingguDan/getHulipingguRemindNum",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliPinggu",  /*匹配到的控制器*/
                    'action'     => "getHulipingguRemindNum",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*终端主模块获取该病区需要护理评估或护理措施的患者列表*/
            "getHulipingguTongji" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/HuliPingguDan/getHulipingguTongji",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliPinggu",  /*匹配到的控制器*/
                    'action'     => "getHulipingguTongji",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*删除护理评估单接口*/
            "delHulipinggu" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/HuliPingguDan/delHulipinggu",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliPinggu",  /*匹配到的控制器*/
                    'action'     => "delHulipinggu",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取体征数据--用于Android端的service同步数据*/
            "getTizhengDataJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getTizhengDataJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetTizhengDataJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取患者列表--用于Android端的service同步数据*/
            "getHuanzheDataJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getHuanzheDataJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetHuanzheDataJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取巡查记录数据--用于Android端的service同步数据*/
            "getXunchaDataJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getXunchaDataJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "XunchaJilu",  /*匹配到的控制器*/
                    'action'     => "getXunchaDataJson",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取巡查记录数据*/
            "getXunchaDetailDataJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getXunchaDetailDataJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "XunchaJilu",  /*匹配到的控制器*/
                    'action'     => "getXunchaDetailDataJson",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取护理记录列表*/
            "getHulijiluList" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getHulijiluList",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliJilu",  /*匹配到的控制器*/
                    'action'     => "getHulijiluList",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取一条护理记录*/
            "getOneHulijiluData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getOneHulijiluData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliJilu",  /*匹配到的控制器*/
                    'action'     => "getOneHulijiluData",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*保存护理记录*/
            "uploadHuliData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/uploadHuliData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliJilu",  /*匹配到的控制器*/
                    'action'     => "uploadHuliData",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
        	/*更新护理记录*/
        	"updatehulijiludata" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/updatehulijiludata",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "HuliJilu",  /*匹配到的控制器*/
        					'action'     => "uploadHuliData",  /*匹配到的控制器方法，默认为index*/
        			),
        	),
            /*获取护理评估单*/
            "getTizhiPingguList" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getTizhiPingguList",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HuliJilu",  /*匹配到的控制器*/
                    'action'     => "getTizhiPingguList",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取费用信息*/
            "getFeiyongData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getFeiyongData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetFeiyongData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取护理统计数据*/
            "getHuliTongjiData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getHuliTongjiData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetHuliTongjiData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*用于接收客户端发送的心跳*/
            "heartBeat" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/heartBeat",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "HeartBeat",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取标本检查列表--用于Android端的service同步数据*/
            "getJianchaDataJson" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getJianchaDataJson",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetJianchaDataJson",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*获取标本检查列表--用于Android端的service同步数据*/
            "GetTingzhiYizhuSql" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/getTingzhiYizhuSql",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetTingzhiYizhuSql",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
        		/*大数据处理*/
        		"dataReplace" => array(
        				"type"  => "rewrite",        //Yaf_Route_Rewrite route
        				"match" => "/".$version."/mobile/ClientCommunication/dataReplace",
        				"route" => array(
        						'module' => $version, /*匹配到的模块,默认为Index*/
        						'controller' => "YizhuHistoryDataUpload",  /*匹配到的控制器*/
        						'action'     => "dataReplace",  /*匹配到的控制器方法，默认为index*/
        				),
        		),
            /*批量体征查询*/
            "GetTizhengBatchData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/GetTizhengBatchData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetTizhengBatchData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*体制单删除*/
            "DeleteTizhiDan" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/DeleteTizhiDan",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "DeleteTizhiDan",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*体制单删除*/
            "delxunchadata" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/Delxunchadata",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "Delxunchadata",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*体制调查*/
            "TizhiSurvey" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/TizhiSurvey",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "TizhiSurvey",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*删除体制单*/
            "DeleteTizhengBatchData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/DeleteTizhengBatchData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "DeleteTizhengBatchData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*删除体制单*/
            "DeleteTizhengData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/DeleteTizhengData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "DeleteTizhengData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
            /*删除体制单*/
            "GetBatchInfoData" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/GetBatchInfoData",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetBatchInfoData",  /*匹配到的控制器*/
                    'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
        	/*更新体制单*/
        	"UpdateTizhengData" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/UpdateTizhengData",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "GetBatchInfoData",  /*匹配到的控制器*/
        					'action'     => "UpdateTizhengData",  /*匹配到的控制器方法，默认为index*/
        			),
        	),/*更新体制单*/
        	"ShowTeachHealthyList" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/TeachHealthy/showTeachHealthyList",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "ShowTeachHealthyList",  /*匹配到的控制器*/
        					'action'     => "index",  /*匹配到的控制器方法，默认为index*/
        			),
        	),
        	/*更新消息接收结果*/
        	"UpdateMsgState" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/UpdateMsgState",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "UpdateMsgState",  /*匹配到的控制器*/
        					'action'     => "index",  /*匹配到的控制器方法，默认为index*/
        			),
        	),
            /*更新消息接收结果*/
        	"GetBingfangXunchaDataJson" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/GetBingfangXunchaDataJson",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "GetBingfangXunchaDataJson",  /*匹配到的控制器*/
        					'action'     => "index",  /*匹配到的控制器方法，默认为index*/
        			),
        	),
            /*更新消息接收结果*/
        	"BingfangHistoryDataUpload" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/BingfangHistoryDataUpload",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "BingfangHistoryDataUpload",  /*匹配到的控制器*/
        					'action'     => "index",  /*匹配到的控制器方法，默认为index*/
        			),
        	),
            /*更新消息接收结果*/
        	"GetBingfangLishiJson" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/GetBingfangLishiJson",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "GetBingfangLishiJson",  /*匹配到的控制器*/
        					'action'     => "index",  /*匹配到的控制器方法，默认为index*/
        			),
        	),
            /*更新消息接收结果*/
        	"GetHishulijiluJson" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/GetHishulijiluJson",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "GetHishulijiluJson",  /*匹配到的控制器*/
        					'action'     => "index",  /*匹配到的控制器方法，默认为index*/
        			),
        	),
            "GetDingShiXunShiDataJson" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/GetDingShiXunShiDataJson",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "GetDingShiXunShiDataJson",  /*匹配到的控制器*/
        					'action'     => "index",  /*匹配到的控制器方法，默认为index*/
        			),
        	),
            "DingshixunshiDataUpload" => array(
                    "type"  => "rewrite",        //Yaf_Route_Rewrite route
                    "match" => "/".$version."/mobile/ClientCommunication/DingshixunshiDataUpload",
                    "route" => array(
                            'module' => $version, /*匹配到的模块,默认为Index*/
                            'controller' => "DingshixunshiDataUpload",  /*匹配到的控制器*/
                            'action'     => "index",  /*匹配到的控制器方法，默认为index*/
                    ),
            ),
            // add by xiadx @20170609 for 自定义表头
            "GetCustomTitleByZhuyuanId" => array(
        			"type"  => "rewrite",        //Yaf_Route_Rewrite route
        			"match" => "/".$version."/mobile/ClientCommunication/GetCustomTitleByZhuyuanId",
        			"route" => array(
        					'module' => $version, /*匹配到的模块,默认为Index*/
        					'controller' => "GetCustomTitleByZhuyuanId",  /*匹配到的控制器*/
        					'action'     => "index",  /*匹配到的控制器方法，默认为index*/
        			),
        	),

            /*获取患者列表--用于Android端的service同步数据*/
            "updateseat" => array(
                "type"  => "rewrite",        //Yaf_Route_Rewrite route
                "match" => "/".$version."/mobile/ClientCommunication/updateseat",
                "route" => array(
                    'module' => $version, /*匹配到的模块,默认为Index*/
                    'controller' => "GetHuanzheDataJson",  /*匹配到的控制器*/
                    'action'     => "updateseat",  /*匹配到的控制器方法，默认为index*/
                ),
            ),
        );

        $router->addConfig($config);
    }

    public function _initView(Yaf_Dispatcher $dispatcher)
    {
        //在这里注册自己的view控制器，例如smarty,firekylin
    }
}
